#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
    int n, k, a;
    cin >> n >> k >> a;

    int start = a;
    for (int i = 1; i < k; i ++) {
        start += 1;
        if (start > n) start = 1;
    }
    cout << start << endl;
    return 0;
}